<?php
namespace app\index\model;

use think\Model;

class tc extends Model
{
    public function addcourse($C_Id,$T_Id){
        $Data = [
            "C_Id" => $C_Id,
            "T_Id" => $T_Id,
        ];
        return $this->insert($Data);
    }

    public function del($C_Id){
        return $this->where("C_Id",$C_Id)->update(["isdelete"=>1]);
    }

    public function re($C_Id){
        return $this->where("C_Id",$C_Id)->update(["isdelete"=>0]);
    }

    public function cleartop($T_Id){
        return $this->where("T_Id",$T_Id)->update(["istop"=>0]);
    }

    public function settop($T_Id,$C_Id){
        return $this->where("T_Id",$T_Id)->where("C_Id",$C_Id)->update(["istop"=>1]);
    }
}
?>